package com.neusoft.mapper;

import com.neusoft.po.Food;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Mapper
public interface FoodMapper {
	@Select("select * from food where businessId=#{businessId} order by foodId")
	public List<Food> listFoodByBusinessId(Integer businessId);

	@Select("select * from food where foodId=#{foodId}")
	public Food getFoodById(Integer foodId);

	@Update("update food set foodPrice=#{foodPrice} where foodId=#{foodId}")
	public int updateFood(Food food);

	@Delete("delete from food where businessId=#{BusinessId} and foodId=#{foodId}")
	public int deleteFoodById(@Param("BusinessId") Integer BusinessId, @Param("foodId")Integer foodId);

	@Update("update food set foodName=#{foodName}, foodExplain=#{foodExplain}, foodPrice=#{foodPrice} where foodId=#{foodId}")
	public int updateFoodById(Food food);
}